<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\Category\CategoryController;
use App\Http\Controllers\Api\Virtual\VirtualController;
use App\Http\Controllers\Api\Vocabulary\VocabularyController;
use App\Http\Controllers\Api\Sentence\SentenceController;
use App\Http\Controllers\Api\LearnWord\LearnWordController;
use App\Http\Controllers\Api\Song\SongController;
use App\Http\Controllers\Api\Pdf\PdfController;

Route::prefix('v1')->name('api.v1.')->group(function() {

    Route::get('category', [CategoryController::class, 'index'])
        ->name('category.index');

    //情境学习单元列表
    Route::get('virtual', [VirtualController::class, 'list'])
        ->name('virtual.list');
    //情境学习单元详情
    Route::get('virtual/page/{unitId}', [VirtualController::class, 'page'])
        ->name('virtual.page');
    //情境学习单元跟读详情
    Route::get('virtual/word/{pageId}', [VirtualController::class, 'word'])
        ->name('virtual.word');

    //单元词汇表单元列表
    Route::get('vocabulary', [VocabularyController::class, 'list'])
        ->name('vocabulary.list');
    //单元词汇表-跟读
    Route::get('vocabulary/follow/{categoryId}', [VocabularyController::class, 'follow'])
        ->name('vocabulary.follow');
    //单元词汇表-拼写
    Route::get('vocabulary/spell/{categoryId}', [VocabularyController::class, 'spell'])
        ->name('vocabulary.spell');
    //单元词汇表-练习
    Route::get('vocabulary/exercise/{categoryId}', [VocabularyController::class, 'exercise'])
        ->name('vocabulary.exercise');

    //常用表达法单元列表
    Route::get('sentence', [SentenceController::class, 'list'])
        ->name('sentence.list');
    //常用表达法-详情
    Route::get('sentence/show/{categoryId}', [SentenceController::class, 'show'])
        ->name('sentence.show');

    //背单词
    Route::get('learn/{categoryId}', [LearnWordController::class, 'index'])
        ->name('learn.index');

    //歌曲歌谣
    Route::get('song', [SongController::class, 'index'])
        ->name('song.index');
    Route::get('song/{songId}', [SongController::class, 'caption'])
        ->name('song.caption');

    //教材点读-目录
    Route::get('pdf/catalog', [PdfController::class, 'catalog'])
        ->name('pdf.catalog');
    //教材点读-书页
    Route::get('pdf', [PdfController::class, 'pdf'])
        ->name('pdf.pdf');
    //教材点读-朗读
    Route::get('pdf/read', [PdfController::class, 'read'])
        ->name('pdf.read');
});
